﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Newtonsoft.Json;

namespace GrayParrot.Web.Formly
{
    /// <summary>
    /// The Select Template Options Attribute...
    /// </summary>
    public class SelectTemplateOptionsAttribute : OptionsTemplateOptionsAttribute
    {
        /// <summary>
        /// Gets or sets the name of the property that is used to group the options...
        /// </summary>
        /// <value>
        /// The group property.
        /// </value>
        [JsonProperty(PropertyName = "groupProp")]
        public string GroupProp { get; set; }

        /// <summary>
        /// Gets or sets a value indicating whether [force load].
        /// </summary>
        /// <value>
        ///   <c>true</c> if [force load]; otherwise, <c>false</c>.
        /// </value>
        [JsonProperty(PropertyName = "forceLoad")]
        public bool ForceLoad { get; set; }

        /// <summary>
        /// Gets or sets the on change callback.
        /// </summary>
        /// <value>
        /// The on change callback.
        /// </value>
        [JsonProperty(PropertyName = "onChange")]
        public string OnChangeCallback { get; set; }

        /// <summary>
        /// Initializes a new instance of the <see cref="SelectTemplateOptionsAttribute"/> class.
        /// </summary>
        public SelectTemplateOptionsAttribute()
        {
            this.ForceLoad = false;
        }
    }
}
